<%--
  Created by IntelliJ IDEA.
  User: ZhuChunXiao
  Date: 2017/5/25
  Time: 15:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<div id="page-content">
  <div class="row">

    <div class="col-lg-12">
      <div class="panel">
        <div class="panel-heading">
          <h3 class="panel-title"> 草稿</h3>
        </div>
        <div class="panel-body">
          <div class="table-jqgrid">
            <table id="ajax_draft_table" >
            </table>
            <div id="ajax_draft_list_page">
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>
</div>



<script type="text/javascript">
    $(function() {
        load_draft_jqGrid();
    });

    function load_draft_jqGrid(){
        jQuery("#ajax_draft_table").jqGrid({
            url:'../main/taskRecord/draftList',
            loadonce: true,
            datatype: "json",
            colNames:['审核内容','所属模块','创建时间','操作','key','url',"docId"],
            colModel:[
                {name:'pname',index:'pname', width:200,searchoptions:{sopt:['cn']}},
                {name:'module',index:'module', width:100,searchoptions:{sopt:['cn']}},
                {name:'time',index:'time', width:100,searchoptions:{sopt:['cn']}},
                {name:'act',index:'act', width:100,sortable:false,search:false,fixed:true},
                {name:'key',index:'key', width:0,search:false,sortable:false,hidden:true},
                {name:'url',index:'url', width:0,search:false,sortable:false,hidden:true},
                {name:'docId',index:'docId',search:false,hidden:true,key:true}
            ],
            rowNum : 10,
            rowList:[10,20,30],
            pager : '#ajax_draft_list_page',
            sortname : '',
            sortorder : "",
            gridComplete:function(){
                $('.ui-search-oper').hide();
              //  $(".ui-jqgrid-bdiv").css("overflow-x","hidden");
              //  jqGridStyle();
            },
            onSelectRow: function (rowId, status, e) {
                var rowId = $("#ajax_draft_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#ajax_draft_table").jqGrid('getRowData', rowId);
            },
            ondblClickRow:function(rowid, iRow, iCol, e){
                var rowId = $("#ajax_draft_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#ajax_draft_table").jqGrid('getRowData', rowId);
                if(rowId !="")
                loadURL(rowDatas.url,$('#page-content'));
            },
            jsonReader: {
                root: "dataRows",
                page: "page",
                total: "total",
                records: "records",
                repeatitems : false
            },
        //    caption : "个人待办事项",
            multiselect : false,
            rownumbers:true,
            gridview:true,
            shrinkToFit:true,
            viewrecords: true,
            autowidth: true,
            height:'auto',
            forceFit:true,
            loadComplete: function() {
            }
        });
        $(window).on('resize.jqGrid', function() {
         //   jQuery("#ajax_draft_table").jqGrid('setGridWidth', $("#ajax_draft_list_row").width());
        })
        jQuery("#ajax_draft_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});

        jQuery("#ajax_draft_table").jqGrid('navGrid', "#ajax_draft_list_page", {
            edit : false,
            add : false,
            del : false,
            search:false
        });
    };

</script>


